import { Controller, Get, Post, Body, HttpCode, Query } from '@nestjs/common';
import { BusinessService as Service } from '../services/business.service';

@Controller('business')
export class BusinessController {

    constructor(private readonly service: Service) { }

    /**
    * 查询列表
    * @param query 
    */
    @Get()
    async getAll(@Query() query): Promise<any> {
        return this.service.findAll({});
    }

    /**
     * 添加
     */
    @Post('/add')
    async add(@Body() body): Promise<any> {
        return this.service.add(body);
    }

    /**
     * 修改
     */
    @Post('/update')
    async update(@Body() body): Promise<any> {
        return this.service.update(body);
    }

    /**
     * 删除
     */
    @Post('/delete')
    async delete(@Body() body): Promise<any> {
        return this.service.delete(body);
    }

}
